package org.dubbo.exception;

import org.dubbo.response.ApiResp;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import lombok.extern.slf4j.Slf4j;


@ControllerAdvice
@Slf4j
public class GlobalException {

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public ApiResp onException(Exception e) {
        log.info("GlobalException",e);
        return ApiResp.error();
    }
}
